package cn.tansanqinger.service.root.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.tansanqinger.dao.sql.admin.AdminSqlDaoImpl;
import cn.tansanqinger.pojo.Admin;
import cn.tansanqinger.service.root.IAdminService;
/**
 * 
 * @author C3H2
 * @time 2021.01
 */
@Service
public class AdminServiceImpl implements IAdminService{

	@Autowired
	private AdminSqlDaoImpl sqlDao;
	
	@Override
	public boolean adminAuthentication(String aid, String around) {
		Admin admin = sqlDao.selectAid(aid);
		if(admin!=null) {
			if(around.equals(admin.getAround())) {
				return true;
			}
			admin.setAround("");
			sqlDao.updataAround(admin);
		}
		return false;
	}

}
